#ifndef GAMEPHASECONTROLLER_H
#define GAMEPHASECONTROLLER_H
#include <QStateMachine>
#include <QGraphicsObject>
#include "playertable.h"

class GamePhaseController : QGraphicsObject
{
    Q_OBJECT
    Q_ENUMS(GAME_PHASE)
    Q_PROPERTY(GAME_PHASE phase READ getPhase WRITE setPhase)
public:
    enum GAME_PHASE
    {
        TURN_START = 0,
        GHOST_ACT,
        GHOST_ARR,
        TAO_ACT,
        TURN_FIN
    };
    GamePhaseController(QGraphicsItem* parent, PlayerTable* t);
    ~GamePhaseController();
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    void setPhase(GAME_PHASE);
    GAME_PHASE getPhase(){return _phase;}

    const static int CONTROL_WIDTH = 180;
    const static int CONTROL_HEIGHT = 50;
protected:
    void createMachine();
    void createState();
    QStateMachine* machine;
    PlayerTable* table;
    QPixmap _pix;
    GAME_PHASE _phase;
    QString c_phase;
signals:
    void TURN_START_PAUSE();
};

#endif // GAMEPHASECONTROLLER_H
